<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue.js基础</title>
</head>

<body>
    <!-- 视图区域 -->
    <div id="app">
        <p>{{ tel |secret }}</p>

    </div>
    <script src="../lib/vue.js"></script>
    <script>
            Vue.filter('secret',(value)=>{
                if(typeof !value=='string'){
                    value=value.toString()
                    return value.replace(/(^1[3-9]\d)\d{4}(\d{4})/g,'$1****$2');
                }
            })
        // 创建vue实例 （vm视图模型）
        let vm = new Vue({
            el: "#app",
            data: {
                tel:13800138000

            },
            methods: {

            }

        })
    </script>
</body>

</html>